package com.jxs.tourist.controller;

import com.jxs.tourist.domain.City;
import com.jxs.tourist.service.CityService;
import com.jxs.tourist.util.JsonResult;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;

@Controller
@RequestMapping("/city")
public class CityController {
    @Resource
    CityService cityService;
    public CityController(){
        System.out.println("init");
    }
    @ResponseBody
    @RequestMapping(value = "/getCity")
    public JsonResult<List<City>> getCity(HttpServletRequest request){
        return new JsonResult<List<City>>(cityService.getCitys(),"获取成功",0);
    }
}
